<template>
    <div class="news-detail">
        <h3 class="news-title">{{data.name}}</h3>
        <div class="post-meta">
            <span class="news-time">激活时间：{{renderDate(data.activeTime)}}</span>
            <span class="news-time">注册时间：{{renderDate(data.createTime)}}</span>
            <span class="news-state"><i>|</i>激活状态：{{!data.activeState?'未激活':'已激活'}}</span>
            <span class="news-source"><i>|</i>公司地址：{{data.address}}</span>
            <span class="news-source"><i>|</i>邀请面试数量：{{data.auditionNum}}</span>
            <span class="news-source"><i>|</i>收藏简历数量：{{data.collectNum}}</span>
            <span class="news-source"><i>|</i>全媒对接人：{{data.contactName}}</span>
            <span class="news-source"><i>|</i>姓名：{{data.realName}}</span>
            <br>
            <span class="news-source">所在部门：{{data.department}}</span>
            <span class="news-source"><i>|</i>职位：{{data.position}}</span>
            <span class="news-source"><i>|</i>微信昵称：{{data.nickname}}</span>
        </div>
        <h3 class="title" v-if="data.profile">公司简介</h3>
        <div class="summary" v-if="data.profile">
            <span>{{data.profile}}</span>
        </div>
        <h3 class="title" v-if="data.autoResponse">邀请面试自动回复内容</h3>
        <div class="summary" v-if="data.autoResponse">
            <span>{{data.autoResponse}}</span>
        </div>
        <h3 class="title" v-if="data.avatar">其他信息</h3>
        <div class="summary" v-if="data.avatar">
            <img :src="data.avatar" alt="">
        </div>
        <h3 class="title" v-if="data.logoImg&&data.logoImg.url">公司logo</h3>
        <div class="summary" v-if="data.logoImg&&data.logoImg.url">
            <img :src="data.logoImg&&data.logoImg.url" alt="">
        </div>
    </div>
</template>

<script>
    import api from '@/api'
    export default {
        name: 'news',
        data(){
            return {
                data: {}
            }
        },
        created () {
            this.fetch()
        },
        methods: {
            renderDate(uninx) {
                uninx*=1;
                return uninx.toDate()
            },
            fetch(){
                let id = this.$route.query.id;
                api.getEmployerDetail({id: id}).then(res => {
                    if (res.code == 200 && res.data) {
                        this.data = res.data
                    }
                })
            }
        }
    }
</script>

<style lang="scss" scoped>
    .news-detail{
        .news-title{
            font-size: 26px;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
            /*text-align: center;*/
            word-break: break-word;
            font-weight: 400;
            line-height: 1.5;
            margin: 0;
            padding:0;
        }
        .summary{
            margin: 0 0 30px;
            background: #f5f8fb;
            padding: 30px 20px;
            font-size: 12px;
            img{
                    max-height: 500px;
                    max-width: 500px;
                }
        }
        .title{
            margin: 15px 0 20px 0;
            color: #666;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
            font-size: 18px;
        }
        .post-meta{
            margin: 15px 0 20px 0;
            color: #999;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
            font-size: 12px;
            /*text-align: center;*/

            span{
                margin:5px 0;
                display: inline-block;

                i{
                    font-style: normal;
                    /*display: inline-block;*/
                    margin: 0 10px;
                }
            }
        }
        .post-body{
            text-align: justify;
            font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
            font-size: 16px;
            line-height: 2;
            color: #555;
        }
    }
</style>

